//
//  AppDelegate.m
//  MvvmDemo
//
//  Created by 吴伟城 on 2018/12/16.
//  Copyright © 2018 吴伟城. All rights reserved.
//

#import "AppDelegate.h"
#import "MDCoordinatorManager.h"

@interface AppDelegate ()

@property (strong, nonatomic) MDCoordinatorManager *coordinatorManager;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
  UIViewController *rootVC = [[UIViewController alloc] init];
  rootVC.view.backgroundColor = [UIColor whiteColor];
  
  UINavigationController *rootNav = [[UINavigationController alloc] initWithRootViewController:rootVC];
  rootNav.view.backgroundColor = [UIColor whiteColor];
  
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  self.window.rootViewController = rootNav;
  [self.window makeKeyAndVisible];
  
  self.coordinatorManager = [[MDCoordinatorManager alloc] init];
  self.coordinatorManager.navigationController = rootNav;
  if ([self.coordinatorManager respondsToSelector:@selector(application:didFinishLaunchingWithOptions:)]) {
    [self.coordinatorManager application:application didFinishLaunchingWithOptions:launchOptions];
  }
  return YES;
}

@end
